<template>
	<view class="inte">
		<view class="inte_header">
			<view class="qwert">
				<view class="inte_header_title">
					积分余额(分)
				</view>
				<view class="inte_header_Number">
					<span>{{DataList.usableIntegral}}</span>
				</view>
			</view>
			<view class="qwert">
				<view class="inte_header_title2" v-if="this.interValue == 3">
					待释放积分
				</view>
				<view class="inte_header_title2" v-else>
					待释放金粉
				</view>
				<view class="inte_header_Number2">
					<span>{{DataList.stayReleaseIntegral}}</span>
				</view>
			</view>
		</view>
		<view class="inte_foot">
			<view class="inte_foot_title" :class="item.show === true? 'show':''" v-for="(item,index) in integList"
				:key="index" @click="SearchNumber(index)">
				{{item.name}}
			</view>
		</view>
		<scroll-view class="inte_flot" :scroll-y="true">
			<view class="inte_flot_info" v-for="(item,index) in DataList.memberScores">
				<view class="info">
					<view class="info_left">
						<view class="Info_title">
							{{item.dataremarks}}
						</view>
						<view class="Info_date">
							{{item.createTime|formatDate}}
						</view>
					</view>
					<view class="info_right">
						<span v-if="item.identification === 1">+</span>
						<span v-else>-</span>
						{{item.score}}
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				integList: [{
					name: '全部',
					show: true
				}, {
					name: '收入明细',
					show: false
				}, {
					name: '支出明细',
					show: false
				}],
				interValue: '',
				DataList: {}
			}
		},
		methods: {
			SearchNumber(index) {
				this.integList.forEach(item => {
					item.show = false
				})
				this.integList[index].show = true
				this.$http({
					url: '/MemberScores/queryDynamicIntegralList',
					data: {
						scoreType: this.interValue,
						identification: index
					}
				}).then(res => {
					console.log(res)
					this.DataList = res.data.data
				})
			}
		},
		onLoad(option) {
			console.log(option.value)
			this.interValue = option.value
			this.SearchNumber(0)
			setTimeout(()=>{
				this.SearchNumber(0)
			},5000)
		}
	}
</script>

<style>
	@import './index.css'
</style>
